<template>
  <div class="container">
    <el-carousel :interval="5000" arrow="always" indicator-position="none">
      <el-carousel-item v-for="(item,index) in data.commonInfos" :key="index">
        <a :href="item.detailUrl">
          <el-image class="banner" :src="item.banner_pic" fit="cover"></el-image>
          <div class="banner_desc">{{item.content}}</div>
        </a>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
  export default {
    name: "HomeBanner",
    props: {
      "data": Object
    }
  }
</script>

<style lang="scss">
  @import "assets/Common";

  .el-carousel {
    width: $--window-width;
    a{
      display: block;
      position: relative;
    }

    .banner_desc{
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 50px;
      line-height: 50px;
      background-color:rgba(0,0,0,0.3);
      text-align: left;
      color: white;
      padding-left:16px;
      font-size: 14px;
    }

    .banner {
      width: $--window-width;
      margin: 0 auto;
      text-align: center;
      height: 300px;
    }
  }

</style>
